package com.sike.netty.jinjie.channelPipeline.userevent;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

public class DynamicChannelHandler02 extends ChannelInboundHandlerAdapter {
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("进入 DynamicChannelHandler02");

        if ("01\r\n".equals(msg.toString())) {
            CustomEvent customEvent = new CustomEvent("type-01");
            ctx.fireUserEventTriggered(customEvent);
        } else {
            super.channelRead(ctx, msg);
        }
    }
}
